﻿/// <summary>
/// 格式化领用人，使用人
/// </summary>
/// <param name="value">实际值</param>
/// <returns></returns>
function lingyrFormatter(value) {
    if (value.toString() == "兑换") return "<font color='red'>兑换</font>";
    else return value;
}

/// <summary>
/// 格式化器械包的状态
/// </summary>
/// <param name="value">实际值</param>
/// <returns></returns>
function zhuangtFormatter(value) {
    if (value.toString() == "1") return "包装";
    else if (value.toString() == "2") return "灭菌";
    else if (value.toString() == "3") return "发放";
    else if (value.toString() == "4") return "回收";
    else if (value.toString() == "20") return "待灭菌";
    else if (value.toString() == "30") return "待发放";
    else if (value.toString() == "40") return "待回收";
    else return "其他";
}


function formatDate(value) {
    if (value != "" && value.length > 0) return value.split(" ")[1];
    else return value;
}

/// <summary>
/// 验证邮箱
/// </summary>
/// <param name="email">邮箱值</param>
/// <returns></returns>
function checkEmail(email) {
    var pattern = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
    flag = pattern.test(email);
    return flag;
}

/// <summary>
/// 弹出消息提示
/// </summary>
/// <param name="title">标题</param>
/// <param name="content">内容</param>
/// <param name="type">alert类型</param>
/// <returns></returns>
function AlertInfo(title, content, type) {
    $.messager.alert(title, content, type);
}